<template>
  <div>
    <el-dialog
      title="提示"
      :visible.sync="dialogVisible"
      width="600px"
      @close="close"
    >
      <el-form v-if="dialogVisible">
        <el-form-item label="">
          <el-radio-group v-model="qureyData.chkState">
            <el-radio :label="1">通过</el-radio>
            <el-radio :label="2">拒绝</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="审核意见:">
          <el-input
            type="textarea"
            v-model="qureyData.chkRemarks"
            placeholder="请输入内容"
          ></el-input>
        </el-form-item>
        <el-button @click="close">取 消</el-button>
        <el-button type="primary" @click="btnOK">确 定</el-button>
      </el-form>
    </el-dialog>
  </div>
</template>

<script>
import { EditzhuangtaiApi } from "@/api/Questions";
export default {
  name: "examine",
  data() {
    return {
      dialogVisible: false,
      qureyData: {
        chkState: 1,
        chkRemarks: "",
      },
    };
  },
  methods: {
    async btnOK() {
      try {
        await EditzhuangtaiApi(this.qureyData);
        this.$message.success("审核成功");
        this.$emit("updataList");
      } catch (error) {
        console.log(error);
        this.$message.warning("审核失败,请检查网络");
      }
      this.close();
    },
    close() {
      this.qureyData = {
        chkState: 1,
        chkRemarks: "",
      };
      this.dialogVisible = false;
    },
  },
};
</script>

<style >
.el-dialog__header {
  background-color: #409eff !important;
}
</style>